package com.demo2;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-12-21
 * Time: 21:49
 */

//线程池
public class TestDemo5 {
    public static void main(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(10);
        //衣 z Q Ter 执行服务器   新的固定的线程池

        for (int i = 0; i < 100; i++) {
            pool.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("创建的10个线程同时执行 这个100次循环");
                }
            });
        }
    }
}
